var express = require('express');
var router = express.Router();
const { getOrderData,deleteOrderData,updataOrderF,setOrderData }=require('../service/ordersService.js')
//渲染
router.get('/getOrder', async (req, res, next) => {
    const data= await getOrderData()
    // console.log('1',data);
    res.send(data);
    
});
//删除
router.post('/deleteOrder', async (req, res, next) => {
    // console.log('1',req.body)
    const data= await deleteOrderData(req.body)
    res.send(data);
    
});
//修改
router.get('/updataOrder', async (req, res, next) => {
    const data= await updataOrderF(req.query)
    // console.log('adfa',data)
    res.send(data);
    
});
//确认修改
router.post('/setOrderData',async (req,res,next)=>{
    // console.log('进入第一层')
    console.log('进入第一层',req.body)
    const data=await setOrderData(req.body)
    
    res.send(data)
})
module.exports = router;